package com.workcell.workdata.im.component.holder;


import com.workcell.workdata.im.model.app.Origin;

public class ClientOriginHolder {

    private ClientOriginHolder(){}

    private static final ThreadLocal<Origin> holder = new InheritableThreadLocal<>();

    public static Origin get(){
        return holder.get();
    }

    public static String getAppChannel(){
        return holder.get() == null ? null : holder.get().getAppChannel();
    }

    public static void set(Origin origin){
        holder.set(origin);
    }

    public static void remove(){
        holder.remove();
    }
}
